<@page.html title="礼品领取">
<script>
  function recv() {
    var arr = [];
    var cbs = document.getElementsByName("prods");
    if(cbs && cbs.length>0) {
      for(var i=0; i<cbs.length; i++)
        if(cbs[i].checked) arr.push(cbs[i].value);
    }
    if(arr.length==0) {
      window.alert("请选择礼品");
      return;
    }
    var pm = "memberCode="+getEl("memberCode").value+"&prods="+arr.join("|");
    postJson("_recv", pm, function(data){
      window.alert(data.msg);
      if(data.ret) query();
    });
  }
</script>
  <div class="search">
    <form id="fm_query" action="_list">
      <dl>
        <dt>会员卡号</dt>
        <dd><input type="text" name="cardCode" value=""></dd>
        <dd class="button"><input type="button" value="查询" onclick="query();"></dd>
        <dd class="oper"><#if canRecv??><a class="add" href="javascript:recv();">领取</a></#if></dd>
      </dl>
    </form>
  </div>
  <div id="div_list"></div>
<script type="text/javascript">query();</script>
</@page.html>